package com.gl.course2;

import com.gl.course1.Foo;

/**
 * Created by GAOLEI on 2019/7/26.
 */
public class FooBarTest {

    public static void main(String[] args) {
        FooBar fooBar = new FooBar(3);
        new Thread(()->{
            try {
                fooBar.foo(new A());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();
        new Thread(()->{
            try {
                fooBar.bar(new B());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();
    }

    static  class  A implements Runnable{

        public void run() {
            System.out.print("foo");
        }
    }
    static class  B implements Runnable{

        public void run() {
            System.out.print("bar");
        }
    }

}
